package com.yituo.mjworld.mvc.entity.other;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Table(name = "account_change_log", schema = "web_mojianworld_server", catalog = "")
public class AccountChangeLog {
  private int id;
  private String userId;
  private BigDecimal beforeMoney;
  private BigDecimal afterMoney;
  private BigDecimal changeMoney;
  private Date changeDate;
  private Integer changeType;
  private String changeDesc;

  @Id
  @Column(name = "id", nullable = false)
  @GeneratedValue(strategy = GenerationType.AUTO)
  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  @Basic
  @Column(name = "userId", nullable = true, length = 36)
  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  @Basic
  @Column(name = "beforeMoney", nullable = true, precision = 2)
  public BigDecimal getBeforeMoney() {
    return beforeMoney;
  }

  public void setBeforeMoney(BigDecimal beforeMoney) {
    this.beforeMoney = beforeMoney;
  }

  @Basic
  @Column(name = "afterMoney", nullable = true, precision = 2)
  public BigDecimal getAfterMoney() {
    return afterMoney;
  }

  public void setAfterMoney(BigDecimal afterMoney) {
    this.afterMoney = afterMoney;
  }

  @Basic
  @Column(name = "changeMoney", nullable = true, precision = 2)
  public BigDecimal getChangeMoney() {
    return changeMoney;
  }

  public void setChangeMoney(BigDecimal changeMoney) {
    this.changeMoney = changeMoney;
  }

  @Basic
  @Column(name = "changeDate", nullable = true)
  public Date getChangeDate() {
    return changeDate;
  }

  public void setChangeDate(Date changeDate) {
    this.changeDate = changeDate;
  }

  @Basic
  @Column(name = "changeType", nullable = true)
  public Integer getChangeType() {
    return changeType;
  }

  public void setChangeType(Integer changeType) {
    this.changeType = changeType;
  }

  @Basic
  @Column(name = "changeDesc", nullable = true, length = 100)
  public String getChangeDesc() {
    return changeDesc;
  }

  public void setChangeDesc(String changeDesc) {
    this.changeDesc = changeDesc;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    AccountChangeLog that = (AccountChangeLog) o;

    if (id != that.id) return false;
    if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
    if (beforeMoney != null ? !beforeMoney.equals(that.beforeMoney) : that.beforeMoney != null) return false;
    if (afterMoney != null ? !afterMoney.equals(that.afterMoney) : that.afterMoney != null) return false;
    if (changeMoney != null ? !changeMoney.equals(that.changeMoney) : that.changeMoney != null) return false;
    if (changeDate != null ? !changeDate.equals(that.changeDate) : that.changeDate != null) return false;
    if (changeType != null ? !changeType.equals(that.changeType) : that.changeType != null) return false;
    if (changeDesc != null ? !changeDesc.equals(that.changeDesc) : that.changeDesc != null) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = id;
    result = 31 * result + (userId != null ? userId.hashCode() : 0);
    result = 31 * result + (beforeMoney != null ? beforeMoney.hashCode() : 0);
    result = 31 * result + (afterMoney != null ? afterMoney.hashCode() : 0);
    result = 31 * result + (changeMoney != null ? changeMoney.hashCode() : 0);
    result = 31 * result + (changeDate != null ? changeDate.hashCode() : 0);
    result = 31 * result + (changeType != null ? changeType.hashCode() : 0);
    result = 31 * result + (changeDesc != null ? changeDesc.hashCode() : 0);
    return result;
  }
}
